<template>
	<el-tabs v-model="activeName" @tab-click="handleClick">
		<el-tab-pane label="提现管理" name="first">
			<div style="margin:5px;display: inline-block;">
				<div style="position: relative;display: inline-block;">
					<span>支付宝账号：</span>
					<el-input style="width: 200px;" @keydown.enter.native="phoneSelect" placeholder="请输入支付宝账号"
						v-model="zhifubao"></el-input>&nbsp;&nbsp;
					<span @click="phoneSelect" style="position: absolute;right: 18px;top:8px;">
						<icon-svg name="shousuo" class="site-sidebar__menu-icon"></icon-svg>
					</span>
				</div>
				<div style="position: relative;display: inline-block;">
					<span>支付宝名称：</span>
					<el-input style="width: 200px;" @keydown.enter.native="phoneSelect" placeholder="请输入支付宝名称"
						v-model="zhifubaoName"></el-input>&nbsp;&nbsp;
					<span @click="phoneSelect" style="position: absolute;right: 18px;top:8px;">
						<icon-svg name="shousuo" class="site-sidebar__menu-icon"></icon-svg>
					</span>
				</div>
				<div style="margin:5px;display: inline-block;">
					<span>手机号:</span>
					<el-input style="width: 150px;" @keydown.enter.native="phoneSelect" clearable placeholder="请输入手机号"
						v-model="phone"></el-input>
				</div>&emsp;&emsp;
				<div style="position: relative;display: inline-block;margin:5px;">
					<span>状态：</span>
					<el-select v-model="indentState" style="width:150px;margin-left: 10px;" @change="phoneSelect()">
						<el-option v-for="item in statesnum" :key="item.value" :label="item.label" :value="item.value">
						</el-option>
					</el-select>&nbsp;&nbsp;
				</div>
				<div style="position: relative;display: inline-block;margin:5px;">
					<span>用户类型：</span>
					<el-select v-model="userType" style="width:150px;margin-left: 10px;" @change="phoneSelect()">
						<el-option v-for="item in userTypenum" :key="item.value" :label="item.label"
							:value="item.value">
						</el-option>
					</el-select>&nbsp;&nbsp;
				</div>
				<div style="margin:5px;display: inline-block;margin: 5px;">
					<span>提现类型：</span>
					<el-select v-model="classify" placeholder="请选择状态" style="width:150px;" @change="phoneSelect()">
						<el-option v-for="item in classifyList" :key="item.value" :label="item.label"
							:value="item.value">
						</el-option>
					</el-select>&nbsp;&nbsp;&nbsp;
				</div>
				<div style="margin:5px;display: inline-block;">
					<span>用户名称:</span>
					<el-input style="width: 150px;" @keydown.enter.native="phoneSelect" placeholder="请输入用户名称"
						v-model="dailiName">
					</el-input>
				</div>
				<div style="margin:5px;display: inline-block;">
					<span>转账订单号:</span>
					<el-input style="width: 150px;" @keydown.enter.native="phoneSelect" placeholder="请输入转账订单号"
						v-model="orderNumber">
					</el-input>
				</div>
				<div style="margin:5px;display: inline-block;">
					<span>开始时间：</span>
					<el-date-picker style="width: 160px;margin-left: 10px;" v-model="startTime" align="right"
						type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间">
					</el-date-picker>
				</div>
				<div style="margin:5px;display: inline-block;">
					<span>截止时间：</span>
					<el-date-picker style="width: 160px;margin-left: 10px;" v-model="endTime" align="right" type="date"
						format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择截止时间">
					</el-date-picker>
				</div>
				<div style="display: inline-block;margin:5px;">
					<el-button style="margin:10px;" size="mini" type="primary" icon="document" @click="phoneSelect">查询
					</el-button>
					<el-button style="margin:10px;" size="mini" type="primary" icon="document" @click="cleans2">重置
					</el-button>
					<!-- <el-button style='margin:0 0 20px 20px;' size="mini" type="primary" icon="document"
						@click="transferClcik()" :disabled="checkBoxData.length <= 0 || !isAuth('financeList:transfer')">
						批量转账
					</el-button> -->
					<el-button style='margin-left:15px;' size="mini" type="warning" icon="document" @click="exportBtn"
						:disabled="!isAuth('financeList:daochu')">导出Excel
					</el-button>
				</div>
			</div>
			<div style="color: orange;"> * 导出提示：导出数据前请进行时间或者状态等筛选，否则导出数据量过多易出现卡顿或系统崩溃</div>
			<el-table @selection-change="changeFun" v-loading="tableDataLoading" :data="tableData">
				<!--  <el-table-column type="selection">
        </el-table-column> -->
				<el-table-column fixed prop="id" label="编号" width="80">
				</el-table-column>

				<el-table-column prop="userType" label="用户类型" width="100">
					<template slot-scope="scope">
						<span v-if="scope.row.userType==1">用户</span>
						<span v-else-if="scope.row.userType==2">师傅</span>
						<span v-else>-</span>
					</template>
				</el-table-column>
				<el-table-column prop="userName" label="用户名称" width="150">
				</el-table-column>
				<el-table-column prop="zhifubao" label="支付宝账号" width="150">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row)"
							v-if="scope.row.zhifubao">{{scope.row.zhifubao!='null' ? scope.row.zhifubao : '未绑定'}}</span>
						<span v-else>未绑定</span>
					</template>
				</el-table-column>
				<el-table-column prop="phone" label="手机号" width="150">
				</el-table-column>
				<el-table-column prop="orderNumber" label="转账订单号" width="150">
				</el-table-column>
				<el-table-column prop="zhifubaoName" label="支付宝名称" width="100">
					<template slot-scope="scope">
						<span
							v-if="scope.row.zhifubaoName">{{scope.row.zhifubaoName!='null' ? scope.row.zhifubaoName : '未绑定'}}</span>
						<span v-else>未绑定</span>
					</template>
				</el-table-column>
				<el-table-column prop="cashQrCode" label="微信二维码" width="150">
					<template slot-scope="scope">
						<div v-if="scope.row.cashQrCode == null || scope.row.cashQrCode == ''">
							暂无微信二维码
						</div>
						<div v-else style="display:flex;flex-wrap: wrap;">
							<div style="margin: 2px;">
								<el-popover placement="top-start" title="" trigger="hover">
									<img style="width: 50px; height: 50px" :src="scope.row.cashQrCode" alt=""
										slot="reference">
									<img style="width: 300px; height: 300px" :src="scope.row.cashQrCode" alt="">
								</el-popover>
							</div>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="classify" label="提现方式" width="100">
					<template slot-scope="scope">
						<span v-if="scope.row.classify==1">支付宝</span>
						<span v-else-if="scope.row.classify==2">微信</span>
						<span v-else>暂无数据</span>
					</template>
				</el-table-column>

				<el-table-column prop="money" label="提现金额" width="100">
				</el-table-column>
				<el-table-column prop="state" label="状态" width="100">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.state == 0">待转账</span>
						<span v-if="scope.row.state == 1">已转账</span>
						<span v-if="scope.row.state == -1">已拒绝</span>
					</template>
				</el-table-column>
				<el-table-column prop="refund" label="拒绝原因" width="220">
				</el-table-column>
				<el-table-column prop="createAt" label="申请时间" width="170">
				</el-table-column>
				<el-table-column prop="outAt" label="转账/拒绝时间" width="180">
				</el-table-column>

				<el-table-column fixed="right" label="操作" width="180">
					<template slot-scope="scope">
						<el-button size="mini" type="primary"
							:disabled="isAuth('financeList:transfer')&&scope.row.state != 0" @click="batch(scope.row)">
							转账
						</el-button>
						<el-button size="mini" type="primary"
							:disabled="isAuth('financeList:refund')&&scope.row.state != 0" @click="refund(scope.row)">拒绝
						</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
					:page-sizes="[10, 20,30,40]" :page-size="limit" :current-page="page"
					layout="total,sizes, prev, pager, next,jumper" :total="totalnum">
				</el-pagination>
			</div>
			<!-- 拒绝弹框 -->
			<!-- <el-dialog title="拒绝" :visible.sync="dialogFormVisible" center>
				<el-form :model="form">
					<el-form-item label="拒绝原因：" :label-width="formLabelWidth">
						<el-input v-model="form.content" type="textarea" rows="4" placeholder="请输入拒绝原因"
							style="width:65%;"></el-input>
					</el-form-item>
				</el-form>
				<div slot="footer" class="dialog-footer">
					<el-button @click="dialogFormVisible = false">取 消</el-button>
					<el-button type="primary" @click="refundNoticeTo()">确 定</el-button>
				</div>
			</el-dialog> -->
		</el-tab-pane>
		<el-tab-pane label="收入统计" name="second">
			<div>
				<span>时间类型：</span>
				<el-select v-model="flag" style="width:150px;margin-left: 10px;" @change="animeDat">
					<el-option v-for="item in flags" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;&nbsp;
				<el-date-picker style="width: 300px;margin-left: 10px;" v-model="info1.stockDate1" align="right"
					type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间"
					@change="animeSelect">
				</el-date-picker>
			</div>
			<el-row>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">支付金额</div>
							<div class="text_color">
								<span>{{MoneyData.payOrdersMoney ? (MoneyData.payOrdersMoney).toFixed(2) : 0}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">司机收益</div>
							<div class="text_color">
								<span>{{MoneyData.driverMoney ? (MoneyData.driverMoney).toFixed(2) : 0}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">一级收益</div>
							<div class="text_color">
								<span>{{MoneyData.oneUserMoney ? (MoneyData.oneUserMoney).toFixed(2)  : 0}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">二级收益</div>
							<div class="text_color">
								<span>{{MoneyData.twoUserMoney ? (MoneyData.twoUserMoney).toFixed(2)  : 0}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">平台任务收益</div>
							<div class="text_color">
								<span>{{MoneyData.pingMoney ? (MoneyData.pingMoney).toFixed(2)  : 0}}</span>元
							</div>
						</div>
					</div>
				</el-col>
			</el-row>
		</el-tab-pane>
		<el-tab-pane label="提现统计" name="third">
			<div>
				<span>时间类型：</span>
				<el-select v-model="flag" style="width:150px;margin-left: 10px;" @change="animeDat2">
					<el-option v-for="item in flags" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;&nbsp;
				<el-date-picker style="width: 300px;margin-left: 10px;" v-model="info1.stockDate1" align="right"
					type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间"
					@change="animeSelect2">
				</el-date-picker>
			</div>
			<el-row>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">累计提现金额</div>
							<div class="text_color">
								<span>{{withdrawData.sumMoney}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">提现次数</div>
							<div class="text_color">
								<span>{{withdrawData.countMoney}}</span>笔
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">待转账次数</div>
							<div class="text_color">
								<span>{{withdrawData.stayMoney}}</span>笔
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">申请提现金额</div>
							<div class="text_color">
								<span>{{withdrawData.applyMoneySum}}</span>元
							</div>
						</div>
					</div>
				</el-col>
			</el-row>
			<el-row>

				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">累计提现金额(提现成功)</div>
							<div class="text_color">
								<span>{{withdrawData.sumMoneySucceed}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">提现笔数(提现成功)</div>
							<div class="text_color">
								<span>{{withdrawData.countMoneySucceed}}</span>笔
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">待转账金额</div>
							<div class="text_color">
								<span>{{withdrawData.sumMoneyAwait}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">已转账金额</div>
							<div class="text_color">
								<span>{{withdrawData.accomplishMoneySum}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">已拒绝金额</div>
							<div class="text_color">
								<span>{{withdrawData.refuseMoneySum}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">支付宝提现金额</div>
							<div class="text_color">
								<span>{{withdrawData.zhifubaoMoneySum}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">微信提现金额</div>
							<div class="text_color">
								<span>{{withdrawData.weixinMoneySum}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">保证金退款统计金额</div>
							<div class="text_color">
								<span>{{withdrawData.cashDepositMoneySum}}</span>元
							</div>
						</div>
					</div>
				</el-col>
			</el-row>
		</el-tab-pane>

		<el-tab-pane label="充值统计" name="sixth">
			<div>
				<span>时间类型：</span>
				<el-select v-model="flag" style="width:150px;margin-left: 10px;" @change="animeDat3">
					<el-option v-for="item in flags" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;&nbsp;
				<el-date-picker style="width: 300px;margin-left: 10px;" v-model="info1.stockDate1" align="right"
					type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间"
					@change="animeSelect3">
				</el-date-picker>
			</div>
			<el-row>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">充值总金额</div>
							<div class="text_color"><span>{{rechgeData.sumMoney ? rechgeData.sumMoney : 0}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">微信充值金额</div>
							<div class="text_color">
								<span>{{rechgeData.wxMoney ? rechgeData.wxMoney : 0}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">支付宝充值金额</div>
							<div class="text_color">
								<span>{{rechgeData.zfbMoney ? rechgeData.zfbMoney : 0}}</span>元
							</div>
						</div>
					</div>
				</el-col>
			</el-row>
		</el-tab-pane>
		<el-tab-pane label="充值记录" name="fourth">
			<div style="margin:5px;display: inline-block;">
				<span>状态：</span>
				<el-select v-model="state" placeholder="请选择状态" style="width:150px;" @change="selectTrigger(state)">
					<el-option v-for="item in states" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>
			</div>
			<div style="margin:5px;display: inline-block;margin: 5px;">
				<span>充值方式：</span>
				<el-select v-model="classify" placeholder="请选择状态" style="width:150px;"
					@change="selectTrigger(classify)">
					<el-option v-for="item in classifyListCz" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;&nbsp;
			</div>
			<div style="margin:5px;display: inline-block;">
				<span>用户名称:</span>
				<el-input style="width: 150px;" @keydown.enter.native="selectTrigger" placeholder="请输入用户名称"
					v-model="dailiName">
				</el-input>
			</div>
			<div style="margin:5px;display: inline-block;">
				<span>充值订单号:</span>
				<el-input style="width: 150px;" @keydown.enter.native="selectTrigger" placeholder="请输入充值订单号"
					v-model="orderNumber">
				</el-input>
			</div>
			<div style="display: inline-block;">
				<span>开始时间：</span>
				<el-date-picker style="width: 160px;margin-left: 10px;" v-model="startTime" align="right" type="date"
					format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间">
				</el-date-picker>&nbsp;&nbsp;&nbsp;
				<span>截止时间：</span>
				<el-date-picker style="width: 160px;margin-left: 10px;" v-model="endTime" align="right" type="date"
					format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择截止时间">
				</el-date-picker>
				<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="timeDate">查询
				</el-button>
				<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="timeDatecz">重置
				</el-button>
			</div>
			<el-table v-loading="tableDataLoading" :data="rechargeData.list">
				<el-table-column fixed prop="id" label="编号" width="80">
				</el-table-column>
				<el-table-column prop="nickName" label="用户名称">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="updates(scope.row)">{{scope.row.nickName ? scope.row.nickName : '未绑定'}}</span>
					</template>
				</el-table-column>
				<el-table-column prop="orderId" label="充值订单号" width="200"></el-table-column>
				<el-table-column prop="money" label="充值金额"></el-table-column>
				<el-table-column prop="userId" label="会员编号"></el-table-column>
				<el-table-column label="充值方式">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 1">app微信 </span>
						<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 2">微信公众号</span>
						<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 3">微信小程序</span>
						<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 4">支付宝H5</span>
						<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 5">支付宝APP</span>
						<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 6">扫码支付</span>
					</template>
				</el-table-column>
				<el-table-column label="状态">
					<template slot-scope="scope">
						<span style="color: #999;cursor: pointer;" v-if="scope.row.state == 0">待支付</span>
						<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.state == 1">支付成功</span>
						<span style="color: red;cursor: pointer;" v-if="scope.row.state == 2">支付失败</span>
					</template>
				</el-table-column>
				<el-table-column prop="createTime" label="创建时间" width="170">
				</el-table-column>
				<el-table-column prop="payTime" label="支付时间" width="170">
					<template slot-scope="scope">
						<span v-if='scope.row.payTime==null'>暂未支付</span>
						<span v-else>{{scope.row.payTime}}</span>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
					:page-sizes="[10, 20,30,40]" :page-size="limit" :current-page="page"
					layout="total,sizes, prev, pager, next,jumper" :total="rechargeData.totalCount">
				</el-pagination>
			</div>
		</el-tab-pane>
		<el-tab-pane label="保证金管理" name="baozhengjin">
			<div style="margin:2% 0;display: inline-block;">
				<span>手机号:</span>
				<el-input style="width: 150px;" @keydown.enter.native="phoneSelect1" clearable placeholder="请输入手机号"
					v-model="phone"></el-input>
			</div>&emsp;&emsp;
			<div style="position: relative;display: inline-block;">
				<span>状态：</span>
				<el-select v-model="type" style="width:150px;margin-left: 10px;" @change="phoneSelect1(type)">
					<el-option v-for="item in statesnum1" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;
			</div>
			<div style="display: inline-block;">
				<el-button style="margin:10px;" size="mini" type="primary" icon="document" @click="phoneSelect1">查询
				</el-button>
				<el-button style="margin:10px;" size="mini" type="primary" icon="document" @click="cleans1">重置
				</el-button>
			</div>
			<el-table @selection-change="changeFun" v-loading="tableDataLoading" :data="tableData">
				<!-- 多选 -->
				<!-- <el-table-column type="selection">
        </el-table-column> -->
				<el-table-column fixed prop="id" label="编号" width="80">
				</el-table-column>
				<el-table-column prop="nickName" label="用户昵称">
					<template slot-scope="scope">
						<div style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row)">
							{{scope.row.nickName?scope.row.nickName:'未绑定'}}
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="money" label="保证金">
				</el-table-column>
				<el-table-column prop="phone" label="手机号">
					<template slot-scope="scope">
						<span>{{scope.row.phone ? scope.row.phone : '暂无'}}</span>
					</template>
				</el-table-column>
				<el-table-column prop="title" label="标题">
				</el-table-column>
				<el-table-column prop="content" label="内容">
				</el-table-column>
				<el-table-column prop="createTime" label="创建时间" width="150">
				</el-table-column>
				<el-table-column prop="type" label="状态" width="100">
					<template slot-scope="scope">
						<span v-if="scope.row.type == 1">已交保证金</span>
						<span v-if="scope.row.type == 2">已退保证金</span>
					</template>
				</el-table-column>
				<!-- <el-table-column fixed="right" label="操作" width="180">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" :disabled="isAuth('financeList:transfer')&&scope.row.state != 0"
							@click="batch(scope.row)">转账
						</el-button>
						<el-button size="mini" type="primary" :disabled="isAuth('financeList:refund')&&scope.row.state != 0"
							@click="refund(scope.row)">拒绝
						</el-button>
					</template>
				</el-table-column> -->
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
					:page-sizes="[ 10, 20,30,40]" :page-size="limit" :current-page="page"
					layout="total,sizes, prev, pager, next,jumper" :total="totalnum">
				</el-pagination>
			</div>

		</el-tab-pane>
		<el-tab-pane label="平台收入统计" name="pingtai">
			<div>
				<span>时间类型：</span>
				<el-select v-model="flag" style="width:150px;margin-left: 10px;" @change="animeDat2">
					<el-option v-for="item in flags" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;&nbsp;
				<el-date-picker style="width: 300px;margin-left: 10px;" v-model="info1.stockDate1" align="right"
					type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间"
					@change="animeSelect2">
				</el-date-picker>
			</div>
			<el-row>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">总收入</div>
							<div class="text_color">
								<span>{{platformData.allMoneySum}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">师傅保证金收入</div>
							<div class="text_color">
								<span>{{platformData.cashDepositMoney}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">扣除师傅保证金收入</div>
							<div class="text_color">
								<span>{{platformData.deductMoneySum}}</span>元
							</div>
						</div>
					</div>
				</el-col>
				<el-col :span="6" class="cards">
					<div class="box">
						<div class="box_num">
							<div class="box_color">订单收入</div>
							<div class="text_color">
								<span>{{platformData.ordersPingMoney}}</span>元
							</div>
						</div>
					</div>
				</el-col>
			</el-row>
		</el-tab-pane>
		<!-- 拒绝弹框 -->
		<el-dialog title="拒绝" :visible.sync="dialogFormVisible" center>
			<el-form :model="form">
				<el-form-item label="拒绝原因：" :label-width="formLabelWidth">
					<el-input v-model="form.content" type="textarea" rows="4" placeholder="请输入拒绝原因" style="width:65%;">
					</el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible = false">取 消</el-button>
				<el-button type="primary" @click="refundNoticeTo()">确 定</el-button>
			</div>
		</el-dialog>
	</el-tabs>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				limit: 10,
				balance: -1,
				zhifubao: '',
				tkstatus: -1,
				state: 1,
				states: [{
						label: '全部',
						value: ''
					},
					{
						label: '待充值',
						value: 0
					},
					{
						label: '充值成功',
						value: 1
					},
					{
						label: '充值失败',
						value: 2
					}
				],
				zhifubaoName: '',
				content: '',
				startTime: '',
				endTime: '',
				cashId: '',
				type: 1,
				totalnum: 0,
				totalnum2: 0,
				sqxTotal: '',
				userTotal: '',
				taunTotal: '',
				relationId: '',
				sumMoneyByTime: '',
				money: '',
				activeName: 'first',
				formLabelWidth: '200px',
				dialogFormVisible: false,
				dialogFormVisible1: false,
				dialogFormVisible2: false,
				tableDataLoading: false,
				tableData: [],
				rechargeData: {},
				platformData: {},
				rechgeData: {},
				withdrawData: {},
				depositData: [],
				MoneyData: {},
				checkBoxData: [], //多选框选择的值
				flag: '',
				flag1: '',
				form: {
					cashId: '',
					content: '',
				},
				form2: {
					id: '',
					money: '',
					createTime: ''
				},
				info: {
					stockDate: this.getNowTime(), //日期
				},
				info1: {
					stockDate1: this.getNowTime1(), //日期
				},
				info2: {
					stockDate2: this.getNowTime2(), //日期
				},
				dateType: 'day',
				flags: [{
					value: 'day',
					label: '按天查询'
				}, {
					value: 'month',
					label: '按月查询'
				}, {
					value: 'year',
					label: '按年查询'
				}],
				indentState: '',
				statesnum: [{
						value: '',
						label: '全部'
					},
					{
						value: 0,
						label: '待转账'
					}, {
						value: 1,
						label: '已转账'
					}, {
						value: -1,
						label: '已拒绝'
					}
				],
				statesnum1: [{
						value: '',
						label: '全部'
					},
					{
						value: 1,
						label: '已交保证金'
					}, {
						value: 2,
						label: '已退保证金'
					}
				],
				phone: '',
				classify: '',
				classifyList: [{
						label: '全部',
						value: ''
					},
					{
						label: '支付宝',
						value: 1
					},
					{
						label: '微信',
						value: 2
					}
				],
				classifyListCz: [{
						label: '全部',
						value: ''
					},
					{
						label: 'app微信',
						value: 1
					},
					{
						label: '微信公众号',
						value: 2
					},
					{
						label: '微信小程序',
						value: 3
					},
					{
						label: '支付宝H5',
						value: 4
					},
					{
						label: '支付宝APP',
						value: 5
					},
					{
						label: '扫码支付',
						value: 6
					},
				],
				userType: '',
				userTypenum: [{
						label: '全部',
						value: ''
					},
					{
						label: '用户',
						value: 1
					},
					{
						label: '师傅',
						value: 2
					}
				],
				dailiName: '',
				orderNumber: '',
				stateT: '',
			}
		},
		methods: {
			// 会员详情跳转
			updates(row) {
				this.$router.push({
					path: '/userDetail',
					query: {
						userId: row.userId
					}
				})
			},
			// 批量转账
			transferClcik(id) {

				var ids = id ? [id] : this.checkBoxData.map(item => {
					return item.id
				})
				for (var i in ids) {
					this.$http({
						url: this.$http.adornUrl(`cash/alipay/${ids[i]}`),
						method: 'post',
						data: this.$http.adornData({})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$notify({
								title: '提示',
								duration: 1800,
								message: data.msg,
								type: 'warning'
							})
							return
						}
						if (data.code == 9999) {
							this.$notify({
								title: '提示',
								duration: 1800,
								message: data.msg,
								type: 'error'
							})
							return
						}
					})
				}
			},
			// 多选
			changeFun(val) {
				this.checkBoxData = val
			},
			//转账
			batch(row) {
				if (row.state == 1) {
					this.$message({
						message: '已转账，请勿重复操作！',
						type: 'error',
						duration: 1500
					})
					return
				}
				this.$confirm(`确定转账?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl(`cash/alipay`),
						method: 'post',
						params: this.$http.adornParams({
							'cashId': row.id
						})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: data.msg,
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.dataSelect()
								}
							})
							return
						}
						if (data.code == 9999) {
							this.$message({
								message: data.msg,
								type: 'error',
								duration: 1500,
								onClose: () => {
									this.dataSelect()
								}
							})
							return
						}
						if (data.code == 500) {
							this.$message({
								message: data.msg,
								type: 'error',
								duration: 1500,
								onClose: () => {
									this.dataSelect()
								}
							})
							return
						}
					})
				})
			},
			// 拒绝
			refund(row) {
				console.log('row', row)
				if (row.state == -1) {
					this.$message({
						message: '已拒绝，请勿重复操作！',
						type: 'error',
						duration: 1500
					})
				} else {
					this.dialogFormVisible = true
					this.form.cashId = row.id
				}
			},
			// 拒绝操作
			refundNoticeTo() {
				if (this.form.content == '') {
					this.$message({
						message: '请输入拒绝原因',
						type: 'error',
						duration: 1500
					})
					return
				}
				this.$http({
					url: this.$http.adornUrl(`cash/refund`),
					method: 'post',
					params: this.$http.adornParams({
						'cashId': this.form.cashId,
						'content': this.form.content
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.dialogFormVisible = false
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.form.content = ''
								this.dataSelect()
							}
						})
						return
					}
					if (data.code == 500) {
						this.dialogFormVisible = false
						this.$message({
							message: data.msg,
							type: 'error',
							duration: 1500,
							onClose: () => {
								this.form.content = ''
								this.dataSelect()
							}
						})
						return
					}
					if (data.code == -100) {
						this.dialogFormVisible = false
						this.$message({
							message: data.msg,
							type: 'error',
							duration: 1500,
							onClose: () => {
								this.form.content = ''
								this.dataSelect()
							}
						})
						return
					}
				})
			},
			timeDate() {
				this.rechargeSelect()
			},
			// 日期选择
			animeDat(value) {
				let vanumber = value
				if (vanumber === 'day') {
					this.flag = 'day'
					this.dateType = 'day'
					this.incomeSelect()
				}
				if (vanumber === 'month') {
					this.flag = 'month'
					this.dateType = 'month'
					this.incomeSelect()

				}
				if (vanumber === 'year') {
					this.flag = 'year'
					this.dateType = 'year'
					this.incomeSelect()
				}
			},
			// 日期选择2
			animeDat2(value) {
				let vanumber = value
				if (vanumber === 'day') {
					this.flag = 'day'
					this.withdrawSelect()
					this.platformSelect()
				}
				if (vanumber === 'month') {

					this.flag = 'month'
					this.withdrawSelect()
					this.platformSelect()
				}
				if (vanumber === 'year') {
					this.flag = 'year'
					this.withdrawSelect()
					this.platformSelect()
				}
			},
			// 日期选择3
			animeDat3(value) {
				let vanumber = value
				if (vanumber === 'day') {
					this.flag = 'day'
					this.flag1 = 1
					this.rechSelect()
				}
				if (vanumber === 'month') {

					this.flag = 'month'
					this.flag1 = 2
					this.rechSelect()
				}
				if (vanumber === 'year') {
					this.flag = 'year'
					this.flag1 = 3
					this.rechSelect()
				}
			},
			animeSelect() {
				this.incomeSelect()
			},
			animeSelect2() {
				this.withdrawSelect()
				this.platformSelect()
			},
			animeSelect3() {
				this.rechSelect()
			},
			//处理默认选中当前日期
			getNowTime1() {
				var now = new Date();
				var year = now.getFullYear(); //得到年份
				var month = now.getMonth(); //得到月份
				var date = now.getDate(); //得到日期
				var hh = now.getHours() < 10 ? "0" + now.getHours() : now.getHours();
				var mm = now.getMinutes() < 10 ? "0" + now.getMinutes() : now.getMinutes();
				var ss = now.getSeconds() < 10 ? "0" + now.getSeconds() : now.getSeconds();
				month = month + 1;
				month = month.toString().padStart(2, "0");
				date = date.toString().padStart(2, "0");
				var defaultDate = `${year}-${month}-${date}`;
				return defaultDate;
				this.$set(this.info, "stockDate", defaultDate);
			},
			getNowTime2() {
				var now = new Date();
				var year = now.getFullYear(); //得到年份
				var month = now.getMonth(); //得到月份
				var date = now.getDate(); //得到日期
				month = month + 1;
				month = month.toString().padStart(2, "0");
				date = date.toString().padStart(2, "0");
				var defaultDate = `${year}-${month}-${date}`;
				return defaultDate;
				this.$set(this.info, "stockDate", defaultDate);
			},
			//处理默认选中当前日期
			getNowTime() {
				var now = new Date()
				var year = now.getFullYear() //得到年份
				var month = now.getMonth() - now.getMonth() //得到月份
				var date = now.getDate() - now.getDate() + 1 //得到日期
				month = month + 1
				month = month.toString().padStart(2, '0')
				date = date.toString().padStart(2, '0')
				var defaultDate = `${year}-${month}-${date}`
				return defaultDate
				this.$set(this.info, 'stockDate', defaultDate)
			},
			handleSizeChange(val) {
				this.limit = val
				this.dataSelect()
			},
			handleCurrentChange(val) {
				this.page = val
				this.dataSelect()
			},
			handleSizeChange1(val) {
				this.limit = val
				this.rechargeSelect()
			},
			handleCurrentChange1(val) {
				this.page = val
				this.rechargeSelect()
			},
			handleSizeChange2(val) {
				this.limit = val
				this.dataSelect1()
			},
			handleCurrentChange2(val) {
				this.page = val
				this.dataSelect1()
			},
			handleClick(tab, event) {
				if (tab._props.label == '提现管理') {
					this.page = 1
					this.limit = 10
					this.type = 1
					this.indentState = ''
					this.phone = ''
					this.dataSelect()
				}
				if (tab._props.label == '收入统计') {
					this.flag = ''
					this.info1.stockDate1 = this.getNowTime1()
					this.incomeSelect()
				}
				if (tab._props.label == '充值统计') {
					this.flag = ''
					this.flag1 = ''
					this.info1.stockDate1 = this.getNowTime1()
					this.rechSelect()
				}
				if (tab._props.label == '提现统计') {
					this.flag = ''

					this.info1.stockDate1 = this.getNowTime1()
					this.withdrawSelect()
				}
				if (tab._props.label == '充值记录') {
					this.dailiName = ''
					this.orderNumber = ''
					this.page = 1
					this.limit = 10
					this.rechargeSelect()
				}
				if (tab._props.label == '保证金管理') {
					this.page = 1
					this.limit = 10
					this.type = ''
					this.indentState = ''
					this.phone = ''
					this.dataSelect1()
				}
				if (tab._props.label == '平台收入统计') {
					this.flag = ''
					this.info1.stockDate1 = this.getNowTime1()
					this.platformSelect()
				}
			},
			// 查询
			phoneSelect() {
				this.page = 1
				this.dataSelect()
			},
			// 重置
			cleans2() {
				this.zhifubao = ''
				this.zhifubaoName = ''
				this.page = 1
				this.indentState = ''
				this.phone = ''
				this.classify = ''
				this.userType = ''
				this.dailiName = ''
				this.orderNumber = ''
				this.indentState = ''
				this.dataSelect()
			},
			phoneSelect1() {
				this.page = 1
				this.dataSelect1()
			},
			// 重置
			cleans1() {
				this.zhifubao = ''
				this.zhifubaoName = ''
				this.page = 1
				this.indentState = ''
				this.phone = ''
				this.startTime = ''
				this.endTime = ''
				this.classify = ''
				this.dataSelect1()
			},
			// 获取数据列表
			dataSelect() {
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('cash/selectAdminHelpProfit'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page,
						'limit': this.limit,
						'zhifubaoName': this.zhifubaoName,
						'zhifubao': this.zhifubao,
						'startTime': this.startTime,
						'endTime': this.endTime,
						'phone': this.phone,
						'classify': this.classify,
						'userType': this.userType,
						'userName': this.dailiName,
						'orderNumber': this.orderNumber,
						'state': this.indentState,
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data
					this.tableData = returnData.records
					this.totalnum = returnData.total
				})
			},
			// 获取数据列表
			dataSelect1() {
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('Details/selectCashDeposit'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page,
						'limit': this.limit,
						'type': this.type,
						'phone': this.phone
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data
					this.tableData = returnData.list
					this.totalnum = returnData.totalCount
				})
			},
			// 收入统计
			incomeSelect() {
				this.$http({
					url: this.$http.adornUrl('orders/platformMoney'),
					method: 'get',
					params: this.$http.adornParams({
						'date': this.info1.stockDate1,
						'dateType': this.flag
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						let returnData = data.data
						this.MoneyData = returnData
						this.MoneyData.indentMoney = this.MoneyData.indentMoney.toFixed(2)
						this.MoneyData.platformMoney = this.MoneyData.platformMoney.toFixed(2)
						this.MoneyData.riderMoney = this.MoneyData.riderMoney.toFixed(2)
					}
				})
			},
			// 充值统计
			rechSelect() {
				this.$http({
					url: this.$http.adornUrl('cash/payMember'),
					method: 'get',
					params: this.$http.adornParams({
						'time': this.info1.stockDate1,
						'flag': this.flag1
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						let returnData = data.data
						this.rechgeData = returnData
						this.rechgeData.sumMoney = Number(this.rechgeData.sumMoney).toFixed(2)
						this.rechgeData.weiXinGZHMoney = Number(this.rechgeData.weiXinGZHMoney).toFixed(2)
						this.rechgeData.weiXinXCXMoney = Number(this.rechgeData.weiXinXCXMoney).toFixed(2)

					}
				})
			},
			// 提现统计
			withdrawSelect() {
				this.$http({
					url: this.$http.adornUrl('cash/statisticsMoney'),
					method: 'get',
					params: this.$http.adornParams({
						'date': this.info1.stockDate1,
						'dateType': this.flag
					})
				}).then(({
					data
				}) => {
					let returnData = data.data
					this.withdrawData = returnData
					this.withdrawData.sumMoney = this.withdrawData.sumMoney.toFixed(2)
					this.withdrawData.applyMoneySum = this.withdrawData.applyMoneySum.toFixed(2)
					this.withdrawData.accomplishMoneySum = this.withdrawData.accomplishMoneySum.toFixed(2)
					this.withdrawData.refuseMoneySum = this.withdrawData.refuseMoneySum.toFixed(2)
					this.withdrawData.zhifubaoMoneySum = this.withdrawData.zhifubaoMoneySum.toFixed(2)
					this.withdrawData.weixinMoneySum = this.withdrawData.weixinMoneySum.toFixed(2)
					this.withdrawData.cashDepositMoneySum = this.withdrawData.cashDepositMoneySum.toFixed(2)
					this.withdrawData.sumMoneySucceed = this.withdrawData.sumMoneySucceed.toFixed(2)
					this.withdrawData.sumMoneyAwait = this.withdrawData.sumMoneyAwait.toFixed(2)

					console.log()
				})
			},
			timeDatecz() {
				this.dailiName = ''
				this.orderNumber = ''
				this.page = 1
				this.rechargeSelect()
			},
			selectTrigger() {
				this.page = 1
				this.rechargeSelect()
			},
			// 获取充值记录
			rechargeSelect() {
				if (this.endTime == '') {
					this.endTime = this.info2.stockDate2
				}
				if (this.startTime == '') {
					this.startTime = this.info.stockDate
				}
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('cash/findTopUpMoney'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page,
						'limit': this.limit,
						'state': this.state,
						'startTime': this.startTime,
						'endTime': this.endTime,
						'nickName': this.dailiName,
						'orderId': this.orderNumber,
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data
					this.rechargeData = returnData
					// this.totalnum2 = returnData.totalCount
				})
			},
			// 平台收入统计
			platformSelect() {
				if (this.endTime == '') {
					this.endTime = this.info2.stockDate2
				}
				if (this.startTime == '') {
					this.startTime = this.info.stockDate
				}
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('orders/incomeStatistics'),
					method: 'get',
					params: this.$http.adornParams({
						'date': this.info.stockDate,
						'dateType': this.flag
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data
					this.platformData = returnData
					// this.totalnum2 = returnData.totalCount
				})
			},
			// 导出
			exportBtn() {
				// if (this.endTime == '') {
				// 	this.endTime = this.info.stockDate
				// }
				// if (this.startTime == '') {
				// 	this.startTime = this.info2.stockDate2
				// }
				// var endTime = this.endTime
				// if (this.endTime != '') {
				// 	endTime = this.endTime + " 23:59:59"
				// }
				this.$http({
					url: this.$http.adornUrl('cash/exportExcel'),
					method: 'get',
					responseType: 'blob',
					params: this.$http.adornParams({
						// 'page': page,
						// 'size': this.size,
						'zhifubaoName': this.zhifubaoName,
						'zhifubao': this.zhifubao,
						// 'type': this.type,
						// 'state': this.indentState,
						'classify': this.classify,
						'phone': this.phone,
						'startTime': this.startTime,
						'endTime': this.endTime,
						'userType': this.userType,
						'userName': this.dailiName,
						'orderNumber': this.orderNumber,
					})
				}).then(({
					data
				}) => {
					let blob = new Blob([data], {
						type: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
					})
					if (window.navigator.msSaveOrOpenBlob) {
						navigator.msSaveBlob(blob)
					} else {
						let url = window.URL.createObjectURL(blob)
						let elink = document.createElement('a')
						elink.download = '提现列表.xlsx'
						elink.style.display = 'none'
						elink.href = url
						document.body.appendChild(elink)
						elink.click()
						document.body.removeChild(elink)
					}
				})
			},
			dataSelect2() {
				if (this.$route.query.status == 0) {
					this.indentState = Number(this.$route.query.status)
				} else {
					this.indentState = ''
				}
				this.dataSelect()
			},
		},
		mounted() {
			if (this.$route.query.status == 0) {
				this.indentState = Number(this.$route.query.status)
			} else {
				this.indentState = ''
			}
			this.dataSelect()
		},
		watch: {
			'$route': 'dataSelect2'
		}
	}
</script>

<style scoped="scoped">
	.box {
		padding: 44px;
		border: 1px solid #eee;
		margin: 15px 10px;
	}

	.box_num {
		font-size: 14px;
		color: #66b1ff;
	}

	.box_num .box_color {
		color: #333;
		font-size: 14px;
		margin-bottom: 15px;
	}

	.box_num div span {
		font-size: 20px;
		margin-left: 5px;
	}

	.text_color {
		color: #4f9dec;
	}

	.text_color span {
		margin-right: 5px;
	}
</style>